﻿#include "forward_socket_tcp.h"

Forward_Socket_Tcp::Forward_Socket_Tcp(QObject *parent) : QTcpSocket(parent)
{
    
}

QByteArray  Forward_Socket_Tcp::readClientData()
{
    if(this->protocolTag() != m_ProtocolTag)
    {
        // 协议不正确
        emit disconnected();
        return "";
    }
    
    return this->readAll();
}

void Forward_Socket_Tcp::setClientProtocolTag(QString &tag)
{
    this->m_ProtocolTag = tag;
}
